#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
const int maxn = 20;
const int mod = 1e9+7;
const int INF = 0x3f3f3f3f;
int d[4][2]={1,0,0,1,-1,0,0,-1};
string s[maxn],mid[maxn];
int w,h,k,cnt=1,flag=0;
struct car{
    int x,y;
}p[10];
void dfs(int now){
    if(now>k||flag)     return ;
    for(int i=1;i<=cnt;i++){
        for(int j=0;j<4;j++){
            int dx=p[i].x+d[j][0],dy=p[i].y+d[j][1];
            while(dx<=h&&dx>0&&dy<=w&&dy>0&&(s[dx][dy]=='.'||s[dx][dy]=='D')){
                dx+=d[j][0],dy+=d[j][1];
            }
            dx-=d[j][0],dy-=d[j][1];
            if(s[dx][dy]=='D'){
                flag=1;
                return ;
            }
            if(p[i].x!=dx||p[i].y!=dy){
                s[p[i].x][p[i].y]='.';
                s[dx][dy]='R';
                p[i].x=dx,p[i].y=dy;
            }
            dfs(now+1);
            if(p[i].x!=dx||p[i].y!=dy){
                s[p[i].x][p[i].y]='R';
                s[dx][dy]='.';
            }
        }
    }
}
int main() {
    ios::sync_with_stdio(0);
    #ifdef Uncle_drew
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #else
    #endif
    cin>>w>>h>>k;
    for(int i=0;i<h;i++)    cin>>s[i];
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(s[i][j]=='R')    p[cnt].x=i,p[cnt++].y=j;
        }
    }
    dfs(0);
    if(flag){
        cout<<"YES\n";
    }else{
        cout<<"NO\n";
    }
    return 0;
}